//饿汉模式
public class HungrySingleton {
    private static final HungrySingleton instance = new HungrySingleton();

    private HungrySingleton() {
        // 私有构造方法，防止其他类通过构造函数创建实例对象
    }

    public static HungrySingleton getInstance() {
        return instance;
    }
}